Skip to content

feat(vido): broadcast outbox (migration 014) - #1

Closed
amtiYo wants to merge 1 commit into
devfrom
feat/vido-broadcasts
Closed

amtiYo wants to merge 1 commit into
devfrom
feat/vido-broadcasts

Conversation

@amtiYo

@amtiYo amtiYo commented Oct 5, 2026

Copy link
Copy Markdown
Member

Adds the outbox Vido's new broadcast tool writes to (FreshLabDev/vido, branch feat/broadcast).

  • vido.broadcasts: one row per campaign, its fingerprint and the photo's Telegram file id once uploaded.
  • vido.broadcast_deliveries: one row per destination chat with the localized message, lease, retry state, Telegram evidence and outcome (delivered, text_only, blocked, deactivated, not_started, removed, no_rights, not_found).

Same delivery contract as 007, two differences:

  • chat_id is not a foreign key. Private chats last seen before July 2026 were recorded with presence chat_id 0 and have no core.chat row; a sign check keeps private and group ids apart instead.
  • The outcome checks spell out IS NOT NULL. A NULL inside IN (...) makes the whole CHECK NULL, which PostgreSQL accepts; the first draft let an unreachable row without an outcome through, and the contract test now covers both statuses.

vido_core gets SELECT, INSERT, UPDATE, no DELETE. The changelog entry for 014 already landed with 015 (4fbdbd8); this adds the operator line, including applying it by hand on vido_test.

Tested: all 15 migrations twice and every contract test on a local PostgreSQL 17 cluster with bin/apply.sh (Docker is not available on this machine, so not through bin/test.sh itself). Not applied anywhere.

vido.broadcasts holds one row per campaign: its fingerprint and the photo's
Telegram file id once uploaded. vido.broadcast_deliveries holds one row per
destination chat with the localized message, lease, retry state, Telegram
evidence and an outcome saying why the chat was or was not reached, which is
what Vido's broadcast report counts.

Same delivery contract as 007, with two differences. chat_id is a bare id
with a sign check instead of a foreign key, because private chats last seen
before July 2026 have no core.chat row. The outcome checks spell out
IS NOT NULL, since a NULL inside IN (...) makes a CHECK pass; the contract
test covers both statuses without an outcome. vido_core can select, insert
and update, never delete.

The changelog entry for 014 already landed with 015; this adds the operator
line for applying it, including by hand on vido_test.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@amtiYo

amtiYo commented Oct 6, 2026

Copy link
Copy Markdown
Member Author

Migration 014 landed on dev as 0130b67, identical to this branch; dev also carries 016 and the updated operator note. Closing as superseded.

@amtiYo amtiYo closed this Oct 6, 2026
@amtiYo
amtiYo deleted the feat/vido-broadcasts branch October 6, 2026 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant